function tests = test_global_ex14_2_7
tests = functiontests(localfunctions);

function test1(testCase)
% Model generated from ex14_2_7.gms
% Created 02-Aug-2007 10:41:08 using YALMIP R20070725

% Setup a clean YALMIP environment 
yalmip('clear') 

% Define all variables 
x1 = sdpvar(1);
x2 = sdpvar(1);
x3 = sdpvar(1);
x4 = sdpvar(1);
x5 = sdpvar(1);
x7 = sdpvar(1);

% Define objective function 
objective = -(0-x7-0);

% Define constraints 
F = ([]);
F=[F,8.85*log(2.11*x1+3.97*x2+3.19*x3+4.5*x4)-9.85*log(1.97*x1+3.01*x2+2.4*x3+3.86*x4)-(3.8613*x2-0.865100000000001*x1+3.7136*x3-0.632999999999999*x4)/(2.11*x1+3.97*x2+3.19*x3+4.5*x4)-0.92*log(0.92*x1+0.074630773041249*x2+0.120222883700913*x3+0.161199992780481*x4)+0.92*log(0.92*x1+3.01*x2+2.4*x3+3.86*x4)-0.92*(0.92*x1/(0.92*x1+0.074630773041249*x2+0.120222883700913*x3+0.161199992780481*x4)+5.42978509857797*x2/(1.65960208993081*x1+3.01*x2+2.91963915785291*x3+1.70144966342223*x4)+3.53361528312402*x3/(1.35455252519754*x1+1.86011323009376*x2+2.4*x3+2.64991431773289*x4)+5.92791255201582*x4/(1.41287034918512*x1+5.85662897318878*x2+2.5957281029371*x3+3.86*x4))-3803.98/(231.47+x5)-x7<=-12.8590236275375];
F=[F,14.05*log(2.11*x1+3.97*x2+3.19*x3+4.5*x4)-15.05*log(1.97*x1+3.01*x2+2.4*x3+3.86*x4)-(7.26510000000001*x2-1.6277*x1+6.9872*x3-1.191*x4)/(2.11*x1+3.97*x2+3.19*x3+4.5*x4)-3.01*log(1.65960208993081*x1+3.01*x2+2.91963915785291*x3+1.70144966342223*x4)+3.01*log(0.92*x1+3.01*x2+2.4*x3+3.86*x4)-3.01*(0.0228107346172588*x1/(0.92*x1+0.074630773041249*x2+0.120222883700913*x3+0.161199992780481*x4)+3.01*x2/(1.65960208993081*x1+3.01*x2+2.91963915785291*x3+1.70144966342223*x4)+1.48314676153655*x3/(1.35455252519754*x1+1.86011323009376*x2+2.4*x3+2.64991431773289*x4)+7.51049429784342*x4/(1.41287034918512*x1+5.85662897318878*x2+2.5957281029371*x3+3.86*x4))-2735.58621973158/(226.276+x5)-x7<=-11.2296864040814];
F=[F,11*log(2.11*x1+3.97*x2+3.19*x3+4.5*x4)-12*log(1.97*x1+3.01*x2+2.4*x3+3.86*x4)-(5.83770000000001*x2-1.3079*x1+5.6144*x3-0.956999999999998*x4)/(2.11*x1+3.97*x2+3.19*x3+4.5*x4)-2.4*log(1.35455252519754*x1+1.86011323009376*x2+2.4*x3+2.64991431773289*x4)+2.4*log(0.92*x1+3.01*x2+2.4*x3+3.86*x4)-2.4*(0.0460854387520165*x1/(0.92*x1+0.074630773041249*x2+0.120222883700913*x3+0.161199992780481*x4)+3.66171411047386*x2/(1.65960208993081*x1+3.01*x2+2.91963915785291*x3+1.70144966342223*x4)+2.4*x3/(1.35455252519754*x1+1.86011323009376*x2+2.4*x3+2.64991431773289*x4)+4.17479603222384*x4/(1.41287034918512*x1+5.85662897318878*x2+2.5957281029371*x3+3.86*x4))-2788.51/(220.79+x5)-x7<=-11.1728763302021];
F=[F,18.3*log(2.11*x1+3.97*x2+3.19*x3+4.5*x4)-19.3*log(1.97*x1+3.01*x2+2.4*x3+3.86*x4)-(8.23500000000001*x2-1.845*x1+7.92*x3-1.35*x4)/(2.11*x1+3.97*x2+3.19*x3+4.5*x4)-3.86*log(1.41287034918512*x1+5.85662897318878*x2+2.5957281029371*x3+3.86*x4)+3.86*log(0.92*x1+3.01*x2+2.4*x3+3.86*x4)-3.86*(0.0384207236678868*x1/(0.92*x1+0.074630773041249*x2+0.120222883700913*x3+0.161199992780481*x4)+1.32677810541474*x2/(1.65960208993081*x1+3.01*x2+2.91963915785291*x3+1.70144966342223*x4)+1.64761511983392*x3/(1.35455252519754*x1+1.86011323009376*x2+2.4*x3+2.64991431773289*x4)+3.86*x4/(1.41287034918512*x1+5.85662897318878*x2+2.5957281029371*x3+3.86*x4))-2739.24733002944/(226.28+x5)-x7<=-11.3821403387577];
F=[F,9.85*log(1.97*x1+3.01*x2+2.4*x3+3.86*x4)-8.85*log(2.11*x1+3.97*x2+3.19*x3+4.5*x4)+(3.8613*x2-0.865100000000001*x1+3.7136*x3-0.632999999999999*x4)/(2.11*x1+3.97*x2+3.19*x3+4.5*x4)+0.92*log(0.92*x1+0.074630773041249*x2+0.120222883700913*x3+0.161199992780481*x4)-0.92*log(0.92*x1+3.01*x2+2.4*x3+3.86*x4)+0.92*(0.92*x1/(0.92*x1+0.074630773041249*x2+0.120222883700913*x3+0.161199992780481*x4)+5.42978509857797*x2/(1.65960208993081*x1+3.01*x2+2.91963915785291*x3+1.70144966342223*x4)+3.53361528312402*x3/(1.35455252519754*x1+1.86011323009376*x2+2.4*x3+2.64991431773289*x4)+5.92791255201582*x4/(1.41287034918512*x1+5.85662897318878*x2+2.5957281029371*x3+3.86*x4))+3803.98/(231.47+x5)-x7<=12.8590236275375];
F=[F,15.05*log(1.97*x1+3.01*x2+2.4*x3+3.86*x4)-14.05*log(2.11*x1+3.97*x2+3.19*x3+4.5*x4)+(7.26510000000001*x2-1.6277*x1+6.9872*x3-1.191*x4)/(2.11*x1+3.97*x2+3.19*x3+4.5*x4)+3.01*log(1.65960208993081*x1+3.01*x2+2.91963915785291*x3+1.70144966342223*x4)-3.01*log(0.92*x1+3.01*x2+2.4*x3+3.86*x4)+3.01*(0.0228107346172588*x1/(0.92*x1+0.074630773041249*x2+0.120222883700913*x3+0.161199992780481*x4)+3.01*x2/(1.65960208993081*x1+3.01*x2+2.91963915785291*x3+1.70144966342223*x4)+1.48314676153655*x3/(1.35455252519754*x1+1.86011323009376*x2+2.4*x3+2.64991431773289*x4)+7.51049429784342*x4/(1.41287034918512*x1+5.85662897318878*x2+2.5957281029371*x3+3.86*x4))+2735.58621973158/(226.276+x5)-x7<=11.2296864040814];
F=[F,12*log(1.97*x1+3.01*x2+2.4*x3+3.86*x4)-11*log(2.11*x1+3.97*x2+3.19*x3+4.5*x4)+(5.83770000000001*x2-1.3079*x1+5.6144*x3-0.956999999999998*x4)/(2.11*x1+3.97*x2+3.19*x3+4.5*x4)+2.4*log(1.35455252519754*x1+1.86011323009376*x2+2.4*x3+2.64991431773289*x4)-2.4*log(0.92*x1+3.01*x2+2.4*x3+3.86*x4)+2.4*(0.0460854387520165*x1/(0.92*x1+0.074630773041249*x2+0.120222883700913*x3+0.161199992780481*x4)+3.66171411047386*x2/(1.65960208993081*x1+3.01*x2+2.91963915785291*x3+1.70144966342223*x4)+2.4*x3/(1.35455252519754*x1+1.86011323009376*x2+2.4*x3+2.64991431773289*x4)+4.17479603222384*x4/(1.41287034918512*x1+5.85662897318878*x2+2.5957281029371*x3+3.86*x4))+2788.51/(220.79+x5)-x7<=11.1728763302021];
F=[F,19.3*log(1.97*x1+3.01*x2+2.4*x3+3.86*x4)-18.3*log(2.11*x1+3.97*x2+3.19*x3+4.5*x4)+(8.23500000000001*x2-1.845*x1+7.92*x3-1.35*x4)/(2.11*x1+3.97*x2+3.19*x3+4.5*x4)+3.86*log(1.41287034918512*x1+5.85662897318878*x2+2.5957281029371*x3+3.86*x4)-3.86*log(0.92*x1+3.01*x2+2.4*x3+3.86*x4)+3.86*(0.0384207236678868*x1/(0.92*x1+0.074630773041249*x2+0.120222883700913*x3+0.161199992780481*x4)+1.32677810541474*x2/(1.65960208993081*x1+3.01*x2+2.91963915785291*x3+1.70144966342223*x4)+1.64761511983392*x3/(1.35455252519754*x1+1.86011323009376*x2+2.4*x3+2.64991431773289*x4)+3.86*x4/(1.41287034918512*x1+5.85662897318878*x2+2.5957281029371*x3+3.86*x4))+2739.24733002944/(226.28+x5)-x7<=11.3821403387577];
F=[F,x1+x2+x3+x4==1];
F=[F,1e-006<=x1<=1];
F=[F,1e-006<=x2<=1];
F=[F,1e-006<=x3<=1];
F=[F,1e-006<=x4<=1];
F=[F,40<=x5<=90];
F=[F,0<=x7];

% Solve problem
sol = optimize(F,objective,sdpsettings('bmibnb.uppersolver','fmincon','solver','bmibnb'));
testCase.assertTrue(sol.problem==0)
testCase.assertTrue(abs(value(objective)-0) <= 1e-2)